Conversation
Signed-off-by: kamilsa <kamilsa16@gmail.com>
Signed-off-by: kamilsa <kamilsa16@gmail.com>
| auto [value_ptr, value_size] = runtime::WasmResult(value_out); | ||
|
|
||
| auto key = memory_->loadN(key_ptr, key_size); | ||
| boost::optional<uint32_t> res{boost::none}; |
There was a problem hiding this comment.
It initializes with none in ctor by def, i suppose.
There was a problem hiding this comment.
yes, but making it explicit improves readability I suppose
| auto encoded_opt_val_size = | ||
| kagome::scale::encode(boost::make_optional(value.length)).value(); |
There was a problem hiding this comment.
EXPECT_OUTCOME_TRUE(encoded_opt_val_size, kagome::scale::encode(boost::make_optional(value.length)));Signed-off-by: kamilsa <kamilsa16@gmail.com>
|
As far as I can tell from the code, the return value is neither to spec (data written), nor what substrate does (value size in storage) or claims to do (value size at offset), but the length of the buffer passed into the function, which the caller knows anyway. After a bit of discussion, we settled for returning the amount of data in store at that offset (option 3) and Parity implemented a fix accordingly in paritytech/substrate#7084. We will update the spec as well and track all progress, including progress on adding the |
|
Thanks! We will fix accordingly |
* Fix storage read Signed-off-by: kamilsa <kamilsa16@gmail.com>
Signed-off-by: kamilsa kamilsa16@gmail.com
Referenced issues
Fixes #520
Description of the Change
Fixes problem of wronlgy returned valur from ext_storage_read
Benefits
Conformance
Possible Drawbacks
None
Usage Examples or Tests
StorageExtensionTest